package com.xy.iot.listener;

import com.xy.iot.common.result.ChannelClientEventData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 信道服务端事件监听
 * @author Administrator
 */
@Slf4j
@Component
public class ChannelClientEventListener implements ApplicationListener<ChannelClientEventData> {

    @Async
    @Override
    public void onApplicationEvent(ChannelClientEventData event) {
        //真正做业务的地方
        try {
            log.info("信道客户端事件通知,线程名称：{},数据信息：{}", Thread.currentThread().getName(), event);
        } catch (Exception e) {
            log.error("信道事件通知处理异常", e);
        }
    }
}

